package com.lengxf.pay.common.service;

import com.lengxf.pay.common.PayException;
import com.lengxf.pay.common.bean.*;

import java.util.Map;

/**
 * 所有支付共有的功能
 * By Lengxf 2023-10-18 14:09:54
 **/
public interface BasePayService {


    /**
     * 跳转支付
     * 返回一个地址或者网页进行支付
     * By Lengxf 2023-10-25 14:21:39
     **/
    String toPay(PayOrder payOrder);

    /**
     * 查询订单
     **/
    Map<String, Object> query(QueryOrder queryOrder);

    /**
     * 退款
     **/
    Map<String, Object> refund(RefundOrder refundOrder);

    /**
     * 退款订单查询
     **/
    Map<String, Object> refundQuery(RefundOrderQuery refundOrderQuery);


    /**
     * 支付回调
     **/
    Map<String, Object> payBack(CallBackParam callBackParam);

    /**
     * 支付回调
     **/
    default Map<String, Object> refundBack(CallBackParam callBackParam) {
        throw new PayException("当前支付方式不支持退款回调");
    }

}
